import Qt 4.7

Rectangle {
    id: btn;

    property alias text: btn_txt.text
    signal clicked

    //border.color:  "#bbb"
    color:"#aaa"
    width: 100;
    height:32;
    smooth: true;
    Text {
        id:btn_txt
        anchors.fill: parent;
        //anchors.topMargin: 3;
        font.pixelSize:16;
        horizontalAlignment: Text.AlignHCenter
        verticalAlignment: Text.AlignVCenter
        color: "#111"
        text: "button"
        smooth: true;
    }
    MouseArea {
        id: ma_btn_menu
        anchors.fill: parent;
        onClicked: {
            btn.clicked();
        }
    }
    transitions: Transition { ColorAnimation { target:btn;  duration: 150;}}
    states:
        State {
            name: "On"
            when: ma_btn_menu.pressed && ma_btn_menu.mouseX>0 && ma_btn_menu.mouseY>0 && ma_btn_menu.mouseY<ma_btn_menu.height && ma_btn_menu.mouseX<ma_btn_menu.width
            PropertyChanges{ target: btn; color:"#888";}
        }

}
